<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>设备绑定管理</title>
		<link rel="stylesheet" href="css/reset.css" />
        <link rel="stylesheet" href="css/table.css" />
        <link rel="stylesheet" href="css/platform.css"/>
        <link rel="stylesheet" href="js/ui/jquery-ui.min.css"/>
        <link rel="stylesheet" href="js/vendor/magicsuggest/magicsuggest-min.css"/>
	</head>
	<body ms-controller="deviceStats">
		<div ms-visible="!loginLogShow">
        	<p class="u-title">设备绑定管理</p>
	        <div class="u-multiform six">
	            <div class="column">
	                <div class="cell">
	                    <label>大区名称：</label>
	                    <div class="cnt-box cnt-combox">
	                        <input id="magicRegion" type="text"/>
	                    </div>
	                </div>
	                <div class="cell">
	                    <label>门店名称：</label>
	                    <div class="cnt-box cnt-combox">
	                        <input id="magicShop" type="text"/>
	                    </div>
	                </div>
				</div>
				<div class="column">
					<div class="cell">
	                    <label>绑定状态：</label>
	                    <div class="cnt-box cnt-combox">
	                        <input id="bindStatus" type="text"/>
	                    </div>
	                </div>
					<div class="cell">
	                    <label>工号：</label>
	                    <input class="u-ipt" ms-duplex="param.staffId">
	                </div>
	            </div>
	            <div class="column btn-box">
	                <div class="cell">
	                    <label></label>
	                    <div class="cnt-box">
	                        <button class="u-btn small" ms-click="param.search">查询</button>
	                    </div>
	                </div>
	            </div>
	        </div>
			<div calss="tableContent">
	            <div id="deviceTb" ms-controller="deviceTb"></div>
	        </div>
		</div>
        <div ms-visible="loginLogShow">
        	<p class="u-title">登录日志管理</p>
        	<div calss="tableContent">
	            <div id="loginTb" ms-controller="loginTb"></div>
	        </div>
			<div class="u-bottomBtnBox">
	            <button type="button" class="u-btn gray" ms-click="back">返回</button>
	        </div>
        </div>
        <div class="u-headTip"><p></p></div>
        
		<div class="popup-loading" ms-visible="popup.loading">
            <div class="bg">
                <div class="loading-box">
                    <img src="img/loading.png" />
                    <p>{{popup.loadingTxt}}</p>
                </div>
            </div>
        </div>
		
		<div class="u-popup" ms-visible="popup.unbind">
            <div class="bg"></div>
            <div class="asTable">
                <div class="asTableCell">
                    <div class="asCell alert">
                        <a href="javascript:;" class="close btn-close" ms-click="popup.close">×</a>
                        <p class="title">提示</p>
                        <div class="container">
                            <div class="warning"></div>
                            <p>确定要解除绑定么？</p>
                        </div>
                        <div class="btn-box">
                            <button class="u-btn btn-close" ms-click="popup.unbindSure">确定</button>
                            <button class="u-btn orange btn-close" type="button" ms-click="popup.close">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
		<div class="u-popup" ms-visible="popup.bind">
			<div class="bg"></div>
			<div class="asTable">
				<div class="asTableCell">
					<div class="asCell dialog">
						<a href="javascript:;" ms-click="popup.close" class="close btn-close">×</a>
						<p class="title">设备绑定</p>
						<div class="container">
							<div class="u-form">
								<div class="column">
									<label>工号：</label>
									<input id="bindStaffId" disabled="disabled" class="u-ipt"/>
								</div>
								<div class="column">
									<label>设备ID：</label>
									<input id="bindDeviceId" disabled="disabled" class="u-ipt"/>
								</div>
								<div class="column">
									<label>设备名称：</label>
									<input id="bindDeviceName" disabled="disabled" class="u-ipt"/>
								</div>
							</div>
						</div>
						<div class="btn-box">
							<button class="u-btn" ms-click="popup.bindSure" type="button">提交</button>
							<button class="u-btn color1 btn-close" ms-click="popup.close" type="button">取消</button>
						</div>
					</div>
				</div>
			</div>
		</div>
        <script type="avalon" id="deviceTbTemplate">
            <div class="tableWrapper">
                <table class="table">
                    <thead>
                        <tr>
                        	<th>序号</th>
                            <th>大区</th>
                            <th>门店</th>
                            <th>工号</th>
                            <th>设备名称</th>
							<th>设备编号</th>
							<th>绑定时间</th>
							<th>最近登录时间</th>
							<th>绑定状态</th>
							<th>解绑</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ms-repeat-row="sources">
                        	<td>{{(oldPage - 1) * peerpagerows + $index + 1}}</td>
                            <td>{{row.regionName}}</td>
                            <td>{{row.storeName}}</td>
                            <td>{{row.staffId}}</td>
                            <td>{{row.deviceName}}</td>
							<td>{{row.deviceId}}</td>
							<td>{{row.bindTime}}</td>
							<td class="operate">
								<a href="javascript:;" ms-click="customFuncs.loginHistory(row)">{{row.lastestLoginTime}}</a>
							</td>
							<td>{{row.bindStatus | isBind}}</td>
							<td class="operate">
								<a href="javascript:;" ms-visible="row.bindStatus == 0" ms-click="customFuncs.bind(row)">绑定</a>
								<a href="javascript:;" ms-visible="row.bindStatus == 1" ms-click="customFuncs.unbind(row)">解绑</a>
							</td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="11">
                                <div class="pager">
                                    <div class="first-page" ms-click="firstpage" ms-class={{firstpagestyle}}>首页</div>
                                    <div class="pre-page" ms-click="prepage" ms-class={{prepagestyle}}>上一页</div>
                                    <div class="current-page">第<input class="current-page-num" type="text" ms-duplex="currentpage" ms-input="jumppage"/>页
                                        <span class="totalpage">共 {{totalpage}} 页</span>
                                    </div>
                                    <div class="next-page" ms-click="nextpage" ms-class={{nextpagestyle}}>下一页</div>
                                    <div class="last-page" ms-click="lastpage" ms-class={{lastpagestyle}}>尾页</div>
								</div>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </script>
        
		<script type="avalon" id="loginTbTemplate">
            <div class="tableWrapper">
                <table class="table">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>工号</th>
                            <th>登录IP</th>
                            <th>设备ID</th>
                            <th>设备名称</th>
							<th>登录时间</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ms-repeat-row="sources">
                        	<td>{{(oldPage - 1) * peerpagerows + $index + 1}}</td>
                            <td>{{row.staffId}}</td>
                            <td>{{row.loginIp}}</td>
                            <td>{{row.deviceId}}</td>
                            <td>{{row.deviceName}}</td>
							<td>{{row.loginTimeStr}}</td>
                        </tr>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="11">
                                <div class="pager">
                                    <div class="first-page" ms-click="firstpage" ms-class={{firstpagestyle}}>首页</div>
                                    <div class="pre-page" ms-click="prepage" ms-class={{prepagestyle}}>上一页</div>
                                    <div class="current-page">第<input class="current-page-num" type="text" ms-duplex="currentpage" ms-input="jumppage"/>页
                                        <span class="totalpage">共 {{totalpage}} 页</span>
                                    </div>
                                    <div class="next-page" ms-click="nextpage" ms-class={{nextpagestyle}}>下一页</div>
                                    <div class="last-page" ms-click="lastpage" ms-class={{lastpagestyle}}>尾页</div>
                                </div>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </script>
		
        <script src="js/jquery.min.js"></script>
        <script src="js/avalon.shim.sn.js"></script>
        <script src="js/ui/jquery-ui.min.js"></script>
        <script src="js/ui/jquery-ui-timepicker-addon.js"></script>
        <script src="js/vendor/magicsuggest/magicsuggest-min.js"></script>
        <script src="js/swift-ui-table-1.1.js"></script>
        <script src="js/platform.js"></script>
        <script src="js/DataInterface/DataInterface.js"></script>
        <script src="js/page/deviceBindStats.js"></script>
        
	</body>
</html>